﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

namespace HZ.Supervise.Web.Secondphase.ReportHospital
{
    public partial class hospitalGoodsDisableLog : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ShowHistor();
            }
        }
        public hospitalGoodsDisableLog() 
        {
            this.ModuleNo = "特殊权限";
            this.PageOperateType = "锁定批号";
        }
        private void ShowHistor()
        {
            StringBuilder where = new StringBuilder();

            if (!string.IsNullOrEmpty(txtExecutionMen.Text.Trim()))
            {
                where.Append(" and ExecutionMen like '%"+txtExecutionMen.Text.Trim()+"%'");
            }
            if (!string.IsNullOrEmpty(txtBatchRecordID.Text.Trim()))
            {
                where.Append(" and BatchRecordID like '%" + txtBatchRecordID.Text.Trim() + "%'");
            }
            if (ddlCity.SelectedValue == "0" || ddlCity.SelectedValue == "1")
            {
                where.Append(" and IsDisable = '" + ddlCity.SelectedValue + "'");
            }
            if (!string.IsNullOrEmpty(txtGoodsID.Text.Trim()))
            {
                where.Append(" and GoodsID like  '%" + txtGoodsID.Text.Trim() + "%'");
            }
            if (!string.IsNullOrEmpty(txtStratTime.Text.Trim()))
            {
                where.Append(" and ExecutionTime>'" + txtStratTime.Text.Trim() + "'");
            }
            if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
            {
                 where.Append(" and ExecutionTime<'" + txtEndTime.Text.Trim() + "'");
            }
            IBLL.IBLL_SpecialAuthority bll_special = new BLL.BLL_SpecialAuthority();
            DataTable dt = bll_special.findAllHospitalGoodsDisableLog(where.ToString());
            StringBuilder buder = new StringBuilder();
            buder.Append("<table>");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                buder.Append("<tr><td>");
                buder.Append(dt.Rows[i]["InforMation"].ToString());
                buder.Append("</td></tr>");
            }
            buder.Append("</table>");
            if (buder.Length > 0)
            {
                Label1.Text = buder.ToString();
            }
            else
            {
                Label1.Text = "暂无符合条件的数据";
            }

        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            ShowHistor();
        }

    }
}
